package com.security.it.core.enums;

/**
 * 验证码方式
 */
public enum ValidateCodeType {
    IMAGE("image"),
    SMS("sms");

    private String code;

    ValidateCodeType(String code) {
        this.code = code;
    }

    public String getCode() {
        return code;
    }

    public static ValidateCodeType getByCode(String code) {
        for (ValidateCodeType type : ValidateCodeType.values()) {
            if (type.code.equals(code)) {
                return type;
            }
        }
        return null;
    }
}
